Send email notification when an application password is added - #9795
Send email notification when an application password is added#9795prasadkarmalkar wants to merge 8 commits into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
johnbillion
left a comment
There was a problem hiding this comment.
Thanks for the PR @prasadkarmalkar!
If you're willing to keep working on this then I have some feedback that I think will greatly improve this implementation. In general, this should look more like the existing wp_site_admin_email_change_notification() function. This means:
- This addition should be encapsulated into a new function that is hooked into the
wp_create_application_passwordaction, probably in default-filters.php and with the function itself in wp-includes/user.php. - A filter such as
send_application_password_created_emailshould be added so conditional logic can be performed to decide whether to send the email. Seesend_site_admin_email_change_emailas as example. - The email contents should use
###FIELD###placeholders instead of numbered placeholders to make the string easier to translate and more maintainable in the future. - The email parameters (to, subject, message, headers) should all pass through a filter. See
site_admin_email_change_emailas an example.
|
Hi @johnbillion, Thanks for the suggestions. I have updated the code as per the requested changes. |
|
@prasadkarmalkar I adjusted the text of the email so it's closer to the password reset email text. What do you think? |
audrasjb
left a comment
There was a problem hiding this comment.
Both the technical implementation and the email content look good to me.
I compared the email with other emails already sent by WP, I think it's consistent.
👍
…ssword is added. This introduces a filterable email notification so users get alerted when an application password is added to their account. The email can be filtered via the `wp_application_password_created_email` filter and disabled via the `wp_send_application_password_created_email` filter. Props prasadkarmalkar, johnbillion, audrasjb. Developed in #9795 Fixes #63927 git-svn-id: https://develop.svn.wordpress.org/trunk@63582 602fd350-edb4-49c9-b593-d223f7449a82
…ssword is added. This introduces a filterable email notification so users get alerted when an application password is added to their account. The email can be filtered via the `wp_application_password_created_email` filter and disabled via the `wp_send_application_password_created_email` filter. Props prasadkarmalkar, johnbillion, audrasjb. Developed in WordPress/wordpress-develop#9795 Fixes #63927 Built from https://develop.svn.wordpress.org/trunk@63582 git-svn-id: http://core.svn.wordpress.org/trunk@62758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This pull request enhances WordPress security by notifying users via email whenever a new application password is added to their account.
Trac ticket: https://core.trac.wordpress.org/ticket/63927
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.